import {useState, memo, useCallback} from 'react'; // Import React if not already done in your app.js o

const Child = memo(({count}) => {
    console.log('Child - render...', count);
    
    return <div>Child</div>
}, () => {
    return false;
})

const Home = () => {
    const [inputValue, setInputValue] = useState('11');
    const [count, setCount] = useState(0);
    const handle = useCallback(() => {
        console.log('Home - render...');
    })

     
  // 处理输入变化的事件处理函数
  const handleInputChange = (event) => {
    setInputValue(event.target.value);
  };
    return (
        <>
        <input type="text" value={inputValue} onChange={handleInputChange}/>
        <div>Home</div>
        <p>count: {count}</p>
        <button onClick={() => {
            setCount(count+1);
        }}>累加</button>
        <button onClick={handle}>测试</button>
        <hr />
        <Child  handle/>
        </>
    )
}


export default Home;

